package com.supermarket.api.repository;

import com.supermarket.api.entity.CategoryEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 分类相关
 * @author 李其伟
 * @date 2023/10/17
 */
@Repository
public interface CategoryRepository extends JpaRepository<CategoryEntity, Long> {

    List<CategoryEntity> findAllByPublishStatusOrderBySortDesc(Integer publishStatus);

    List<CategoryEntity> findAllByPublishStatusAndIdIn(Integer publishStatus,List<Long> ids);
}
